import {observable,action} from 'mobx-miniprogram'
export const store = observable({
  //数据字段
  num1:1,
  num2:2,
  tabbarActiveIndex:0,
  //计算属性
  get sum(){
    return this.num1+this.num2;
  },
  updateNum2:action(function(step){
    this.num1+=step;
  }),
  updateNum1:action(function(step){
    this.num1+=step;
  }),
  updateTabbarActiveIndex:action(function(index){
    this.tabbarActiveIndex = index;
  }),
});